const testSrc = (str)=>/src/.test(str)
export default function myPlugin() {
  const virtualModuleId = 'virtual:my-module'
  const resolvedVirtualModuleId = '\0' + virtualModuleId
  return {
      name: 'my-plugin', // 必须的，将会在 warning 和 error 中显示
    //   enforce: 'post',
    resolveId(id) {
      if (id === virtualModuleId) {
        return resolvedVirtualModuleId
      }
    },
    load(id) {
        if (id === resolvedVirtualModuleId) {
        return `export const msg = "from virtual module"`
        }
    },
    transform(src, id) {
        console.log(111,id)
        return {
          code: src
      }
    },
  }
}